function $import(path, type, id)
{
	if(type == "css") 
	{
		if(id)
			document.write("<" + "link id=\"" + id +"\" href=\"" + path + "\" rel=\"stylesheet\" type=\"text/css\"></" + "link>");
		else
			document.write("<" + "link href=\"" + path + "\" rel=\"stylesheet\" type=\"text/css\"></" + "link>");
	} 
	else 
	{
		document.write("<" + "script type=\"text/javascript\" src=\"" + path + "\"></" + "script>");
	}
}

function $importjs(strPath)
{
    var g_strBasePath = "js";

    var strLastPath = "";
    if(g_strBasePath=="")
        strLastPath = strPath;
    else
        strLastPath = g_strBasePath + "/"+ strPath;
        
    $import(strLastPath, 'js');
}

	//-显示输入提示-
function txtTipInput(vObj, strTip)
{
    var m_oTxt    = typeof(vObj)=="object" ? vObj : document.getElementById(vObj);
    if(m_oTxt==null)
        return;
    
    function in_onFocus()
    {               
        if(m_oTxt.value=="" || m_oTxt.value==strTip)    
        {
            m_oTxt.value = "";
        }
    }
    
    function in_onBlur()
    {
        if(m_oTxt.value=="")
            m_oTxt.value = strTip;
    }
    
    m_oTxt.onfocus = in_onFocus;
    m_oTxt.onblur = in_onBlur;
    in_onBlur();
}

function json2str(o) 
{
	var arr = [];
	var fmt = function(s) 
	{
	   if (typeof s == 'object' && s != null) 
		   return json2str(s);
	   return /^(string|number)$/.test(typeof s) ? "'" + s + "'" : s;
	}
	for (var i in o) 
		arr.push("'" + i + "':" + fmt(o[i]));
	return '{' + arr.join(',') + '}';
}